2) ArmA Reforger Mission Making | Creating The Mission - Herbiie/ArmAReforgerMissionMakingGuide GitHub Wiki

Adding Players

Right now we'll be adding respawning players that go through a spawn points. I'm looking into whether or not more traditional slot screens are available.

Change Active Layer

Firstly, for neatness, we need to change the active layer from System to BluFor. Do this by right clicking the BluFor Layer and clicking "Set as active":

image

Adding Spawn point

In the Resource Browser navigate to ArmAReforger>Prefabs>MP>Spawning and drag "SpawnPoint_US.et" onto the map: image

Now the location of this one actually does matter, as it is where you will spawn! I'm doing a mission to defend the town of Laruns, so I'm going to drag the spawn point into the centre of town. It's best to move things that need to stick on the ground in the "Ground Manipulation" mode:

image

If your object does go into the sky or fall through the floor, don't panic, you can right click on it and select "Snap to ground" to put it at ground level: image

We'll have to force a faction, otherwise if we try to preview it won't know what to spawn us as and will stick us in the ocean. Navigate back to the System layer and click on the GameMode_Plain1:

image

On Object Properties at the right, click on the component "SCR_RespawnSystemComponent":

image

Then select Forced Faction as the US, which is the number 0 (0 for US, 1 for USSR) (you can also force a loadout, otherwise you'll be randomly assigned one of the US loadouts). We will be changing this later on - it's only for testing purposes at the moment!:

image

Exciting times - at this point you can actually join the game! Click on the green "Play" icon to spawn in! image

image

Quitting reforger in the preview will return you to the world editor. You can also play the preview full screen by selecting the drop down next to the preview button in the world editor, and ticking "Play Fullscreen".

Adding AI

Now we need some people to shoot...

Adding AI World

Before we add any AI groups, however, we need to add what's called an "AI World." This is basically activating the AI - I suspect there's some clever functionality to this to allow modding of AI behaviour, but for now we'll go with the default prefab.

Firstly, change your active layer back to system. Then navigate in the Resource Browser to ArmAReforger>Prefabs>AI and drag "SCR_AIWorld.et" into the map: image

Now we've done this, we need to add a Navmesh. This tells the AI where it can move. Click on the SCR_AIWorld_1 and select "NavmeshWorldComponent" from the Object Properties:

image

Then click the ... next to Navmesh file:

image

The one I've been using has been ArmAReforger>Worlds>MP>CTI_Campaign_Eden.nmn:

image

And click OK. Now your AI will know where they can walk! If you want vehicles, you can Enable the second NavmeshWorldComponent and add the vehicle NavMesh file. N.B. the AI currently cannot drive in Reforger - but when they can you will need this second NavMesh.

Adding an AI Group

Once again we'll be using one of the prefab groups, but I will be showing you how to add new soldiers. Adding a base group just means you'll have to add all of the soldiers manually!

Firstly, set OPFOR as your active layer. Then, in the Resource Browser, navigate to ArmAReforger>Prefabs>Groups>OPFOR, and select which group you want to spawn - I'll be going with "Group_USSR_MachineGunTeam.et": image

Whereever you drag this object, the group will spawn (so long as you have ticked the "Spawn Immediately" box, which is on be default). However, my group is a little small, so I want to add a couple of soldiers! Make sure the group isn't underground or in the middle of the air, otherwise they won't spawn. The Snap to Ground option is useful for this.

This is done by going on the Object Properties and clicking the + symbol next to Unit Prefab Slots:

image

Once you've clicked the +, it'll add an empty slot. You need to tell the tool which character you want to use, so click the .. symbol on the 2 row:

image

Then navigate to ArmAReforger>Prefabs>Characters>Factions>OPFOR>USSR_Army and select the character you want, I've gone for a Rifleman:

image

I've added an RTO too for good measure. Your AI group will be stood whereever you put it and will react to incoming fire or seeing and enemy etc. Click the green play button and go fight them if you like!

Adding waypoints

Let's get these guys moving. ArmA Reforger adds quite a few waypoints, some that seem to act (to some extent) like the BIS_fnc_taskDefend and BIS_fnc_taskattack functions of ArmA 3.

Waypoints can be added (there may be other ways) by adding one from the Resource Browser. You can find the prefab waypoints under ArmaReforger>Prefabs>AI>Waypoints. I'm adding an Attack waypoint: image

Under Object Properties give the Waypoint a Name, I'm calling mine "Attack1":

image

Go back to your AI squad, go to the Object Properties and scroll down to Group Waypoints. Click on the + next to "Static Waypoints" (not Scripted):

image

Type in the name of your waypoint:

image

The AI will now move to attack that position!

You can reuse the same waypoint for multiple groups, to have several squads attacking the same position.

I've now updated my mission to have a company of USSR infantry assaulting a platoon+ of US troops, with Defend waypoints:

image

Ending the Mission

Extra special thanks to Naizarak, Ex0 and Cunnah for this section! We can't just keep playing indefinitely, so we need a way to end the mission. I'm going to have two endings:

  1. No OPFOR left in the area around the town.
  2. No BLUFOR left in the town.

We're going to be doing this with triggers and a little bit of scripting.

Firstly, add a new layer called "triggers" for all of your triggers to sit in, and make it the active layer.

Adding a trigger

To add a blank trigger, we're going to be using a new menu! So far, we have been using prefabs for everything - but now we need to create our own trigger with its own scripting. So, in the bottom left hand corner, click on the "Create" button:

image

Now, either using the search function or just by scrolling down, we need to drag the SCR_BaseTriggerEntity into the map - this adds a completely blank trigger. N.B. Make sure you are using SCR_BaseTriggerEntity and not another entity such as BaseGametriggerEntity. SCR_BaseTriggerEntity has certain functions predefined that are used in the script. Using another entity type will not work.

image

Before we get into the scripting, we need to make our trigger cover the correct area and activate properly. To do this we edit the Object Properties under "Unsorted":

image

For trigger shape type I'm selecting the simplest - a sphere, and then making it 500 wide in the Sphere Radius in order to cover my whole AO. If I tick "Draw Shape" I can see what that covers (but this will also appear ingame):

image

We need to set the activation type to "All Changes" - meaning that it will activate any time the conditions are met, and we need to tick "periodic queries" to tell the trigger that we want it to check automatically. I set the update period to the minimum of 0.1:

image

Ok, now we have our trigger added and are ready to start scripting!

Scripting the trigger

To add a script to our trigger we firstly need to give it a name. I've called mine Steve (because I've been sat at my computer for a while and am going strange):

image

Once you've named the trigger, click on the + on the blue "Script" banner, and select "User Script":

image

This should automatically open the script editor, but if it doesn't clikc the "Edit" button:

image

Your screen should now look somethinglike this:

image

Delete the // code here and add the code from this link.

So your script looks like this:

image

Click on Build>Validate Scripts to have the Script Editor check for any errors:

image

This will also save your script.

Back on the World Editor, which should still be open in another window, unCheck "Draw Shape" if it is already checked to stop the trigger appearing ingame!

This is our first end condition created. If there are no alive USSR soldiers in the trigger area, the game will end as a US victory.

For my mission, I want a second end condition where the mission will end if there are no alive US soldiers in the trigger area. To do this, I follow the exact same procedure, going to create and adding a blank trigger, changing the properties as above, and adding a "User Script."

However, rather than the script above, I add in this script, which changes all the references to USSR to US, and all the references to the US to USSR, at this link.

Now if all the US soldiers are killed and the player is also killed (even though they respawn), the mission will end as a USSR victory.